/*****************************************************************************
 *
 *                      HUSONG PROPRIETARY INFORMATION
 *
 *          The information contained herein is proprietary to HUSONG
 *           and shall not be reproduced or disclosed in whole or in part
 *                    or used for any design or manufacture
 *              without direct written authorization from HUSONG.
 *
 *            Copyright (c) 2015 by HUSONG.  All rights reserved.
 *
 *****************************************************************************/
package com.broker.provider.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.broker.provider.base.BaseService;

import me.send.broker.entity.Message;
import me.send.broker.service.MessageService;

/**
 * @author maxmin
 *
 * @date 2015年8月25日 下午2:15:03
 */
public class MessageServiceImpl extends BaseService implements MessageService {

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * me.send.broker.service.MessageService#addMessage(me.send.broker.entity
	 * .Message)
	 */
	public int addMessage(Message message) {
		return messageMapper.addMessage(message);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see me.send.broker.service.MessageService#getMessagesByBrokerId(int)
	 */
	public List<Message> getMessagesByBrokerId(int brokerid, long startid,
			int size) {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("brokerid", brokerid);
		params.put("startid", startid);
		params.put("size", size);
		return messageMapper.getMessagesByBrokerId(params);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * me.send.broker.service.MessageService#getDynamicMessagesByBrokerId(int)
	 */
	public List<Message> getDynamicMessagesByBrokerId(int brokerid,
			long startid, int size) {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("brokerid", brokerid);
		params.put("startid", startid);
		params.put("size", size);
		return messageMapper.getDynamicMessagesByBrokerId(params);
	}

}
